﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Bon.it;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BonIt.Tests
{
    [TestClass]
    public class InputHandler
    {
        [TestMethod]
        public void TextChangedEventHandlerTestSuccessWithNumericInput()
        {
            TextBox tb = new TextBox();
            tb.Text = "1,33";
            InputHandlers.DecimalTextChangedEventHandler(tb,null);      
            Assert.AreEqual("1,33",tb.Text);
        }

        [TestMethod]
        public void TextChangedEventHandlerTestFailWithTextInput()
        {
            TextBox tb = new TextBox();
            tb.Text = "abd";
            InputHandlers.DecimalTextChangedEventHandler(tb, null);
            Assert.AreEqual("", tb.Text);
            
        }
    }
}
